package com.wenhao.netease.internet;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        while (scanner.hasNext()) {
            list.add(scanner.nextInt());
        }
        int M = list.get(list.size() - 1);
        list.remove(list.size() - 1);
        int count = 0;
        for (int i = 0;i < list.size();i++) {
            for (int j = i + 1;j < list.size();j++) {
                if (list.get(i) + list.get(j) <= M) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
